<script>

  // 异步回调队列
  let fnArr = [];
  function myNextTick(fn) {
    // 推入回调队列
    fnArr.push(fn);
    // 微任务执行callbacks
    Promise.resolve().then(()=>{
      fnArr.forEach(cb=>cb());
      fnArr = [];
    })
  }
  myNextTick(()=>{
    console.log(11);
  });
  console.log(33);
  setTimeout(() => {
    console.log(222)
  }, 1000);
</script>